{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "5d904dee",
   "metadata": {},
   "source": [
    "# Example 10: Relativitistic Velocity Addition"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6465ec94",
   "metadata": {},
   "source": [
    "In this example, we will symbolically regress $f(u,v)=\\frac{u+v}{1+uv}$. In relavitity, we know the rapidity trick $f(u,v)={\\rm tanh}({\\rm arctanh}\\ u+{\\rm arctanh}\\ v)$. Can we rediscover rapidity trick with KAN?"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "94056ef6",
   "metadata": {},
   "source": [
    "Intialize model and create dataset"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "0a59179d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "cuda\n",
      "checkpoint directory created: ./model\n",
      "saving model version 0.0\n"
     ]
    }
   ],
   "source": [
    "from kan import *\n",
    "\n",
    "device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n",
    "print(device)\n",
    "\n",
    "# initialize KAN with G=3\n",
    "model = KAN(width=[2,1,1], grid=10, k=3, device=device)\n",
    "\n",
    "# create dataset\n",
    "f = lambda x: (x[:,[0]]+x[:,[1]])/(1+x[:,[0]]*x[:,[1]])\n",
    "dataset = create_dataset(f, n_var=2, ranges=[-0.9,0.9], device=device)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cb1f817e",
   "metadata": {},
   "source": [
    "Train KAN and plot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a87b97b0",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "| train_loss: 2.28e-03 | test_loss: 2.31e-03 | reg: 6.50e+00 | : 100%|█| 20/20 [00:03<00:00,  5.88it"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "saving model version 0.1\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "model.fit(dataset, opt=\"LBFGS\", steps=20);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "3f1cfc9d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZcAAAFICAYAAACcDrP3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAoQklEQVR4nO3de1TUdf7H8dfny0WGOyJSZqYQq6loq6IpKJAGHNlcUwkXq3W3jsZRS3Z/+fO35npJczV3BddqldZC06UtiCRY0RTvbop5yysuXgJDRBhkGK4z398f68wB84Lyhe9cXo9z+sdx9K32med870KWZRlEREQKktQegIiIbA/jQkREimNciIhIcYwLEREpjnEhIiLFMS5ERKQ4xoWIiBTHuBARkeIYFyIiUhzjQkREimNciIhIcYwLEREpjnEhIiLFMS5ERKQ4xoWIiBTnqPYARNZAlmXcuHEDOp0O7u7u8PX1hRBC7bGILBa3XIjuQavVIiUlBUFBQfDz80OvXr3g5+eHoKAgpKSkQKvVqj0ikUUSfBIl0Z3l5eVh4sSJ0Ov1AP679WJi2mpxdXVFRkYGoqOjVZmRyFIxLkR3kJeXh9jYWMiyDKPReNefJ0kShBDIyclhYIiaYVyIbqPVatG9e3fU1tbeMywmkiRBo9GguLgY3t7e7T8gkRXgMRei26SlpUGv17cqLABgNBqh1+uxYcOGdp6MyHpwy4WoGVmWERQUhKKiIjzI0hBCICAgAIWFhTyLjAiMC1EL5eXl8PPza9P7fX19FZyIyDpxtxhRMzqdrk3vr66uVmgSIuvGuBA14+7u3qb3e3h4KDQJkXVjXIia8fX1RWBg4AMfNxFCIDAwEJ07d26nyYisC+NC1IwQArNmzXqo977xxhs8mE90Cw/oE92G17kQtR23XIhu4+3tjYyMDAghIEn3XiKmK/QzMzMZFqJmGBeiO4iOjkZOTg40Gg2EED/Z3W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IYFyIiUhzjQkREimNciIhIcYwLEREpjnGxArIso7KyEgBQWVkJPjyU7BHXgXVhXCyYVqtFSkoKgoKCMGbMGADAmDFjEBQUhJSUFGi1WnUHJOoAXAfWScjMv0XKy8vDxIkTodfrAdz58a6urq7IyMhAdHS0KjMStTeuA+vFuFigvLw8xMbGQpZlGI3Gu/48SZIghEBOTg4XFtkcrgPrxrhYGK1Wi+7du6O2tvaeC8pEkiRoNBoUFxfD29u7/Qck6gBcB9aPx1wsTFpaGvR6fasWFAAYjUbo9Xps2LChnScj6jhcB9aPWy4WRJZlBAUFoaio6IHOhBFCICAgAIWFheb90ETWiuvANjAuFqS8vBx+fn5ter+vr6+CExF1PK4D28DdYhZEp9O16f3V1dUKTUKkHq4D28C4WBB3d/c2vd/Dw0OhSYjUw3VgGxgXC+Lr64vAwMAH3l8shEBgYCA6d+7cTpMRdRyuA9vAuFgQIQRmzZr1UO994403eBCTbALXgW3gAX0Lw/P7ibgObAG3XCyMt7c3MjIyIISAJN37n8d0ZXJmZiYXFNkUrgPrx7hYoOjoaOTk5ECj0UAI8ZPNfNOPaTQa5ObmIioqSqVJidoP14F1Y1wsVHR0NIqLi5GcnIyAgIAWrwUEBCA5ORklJSVcUGTTuA6sF4+5WAFZllFRUYHq6mp4eHigc+fOPGhJdofrwLowLkREpDjuFiMiIsUxLkREpDjGhYiIFMe4EBGR4hgXIiJSHONCRESKY1yIiEhxjAsRESmOcSEiIsUxLkREpDjGhYiIFMe4EBGR4hgXIiJSHONCRESK+39fDYm4kBWoLgAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 500x400 with 6 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "model.plot(beta=10)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5ca6421a",
   "metadata": {},
   "source": [
    "Retrain the model, the loss remains similar, meaning that the locking does not degrade model behavior, justifying our hypothesis that these two activation functions are the same. Let's now determine what this function is using $\\texttt{suggest_symbolic}$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "2ccb7048",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  function  fitting r2    r2 loss  complexity  complexity loss  total loss\n",
      "0  arctanh    0.999992 -15.786788           4                4  -15.786788\n",
      "1      tan    0.999825 -12.397871           3                3  -12.397871\n",
      "2   arccos    0.998852  -9.753944           4                4   -9.753944\n",
      "3   arcsin    0.998852  -9.753944           4                4   -9.753944\n",
      "4     sqrt    0.982166  -5.808383           2                2   -5.808383\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "('arctanh',\n",
       " (<function kan.utils.<lambda>(x)>,\n",
       "  <function kan.utils.<lambda>(x)>,\n",
       "  4,\n",
       "  <function kan.utils.<lambda>(x, y_th)>),\n",
       " 0.999992311000824,\n",
       " 4)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.suggest_symbolic(0,1,0,weight_simple=0.0)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0092be41",
   "metadata": {},
   "source": [
    "We can see that ${\\rm arctanh}$ is at the top of the suggestion list! So we can set both to arctanh, retrain the model, and plot it."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "1bb96fe1",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "r2 is 0.9999759197235107\n",
      "saving model version 0.2\n",
      "r2 is 0.999992311000824\n",
      "saving model version 0.3\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "tensor(1.0000, device='cuda:0')"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.fix_symbolic(0,0,0,'arctanh')\n",
    "model.fix_symbolic(0,1,0,'arctanh')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "83b852a3",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "| train_loss: 7.94e-04 | test_loss: 9.43e-04 | reg: 4.12e+00 | : 100%|█| 20/20 [00:04<00:00,  4.34it"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "saving model version 0.4\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "model.fit(dataset, opt=\"LBFGS\", steps=20, update_grid=False);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "9ccd0923",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZcAAAFICAYAAACcDrP3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAlXklEQVR4nO3deXTU5b3H8c8zhJCEJAZiQBFUEoKCFVQELEsBBYKmtQpVUlq3IpdSgZbbntbrbQUXrFq8BkrrVejCVqMYrCIc4B5kUbAGKYgie7Q2YEAkA1mGrL/7x8NkQZYAv2S29+scz+HMMPgN+szn9+zGcRxHAAC4yBPoAgAA4YdwAQC4jnABALiOcAEAuI5wAQC4jnABALiOcAEAuI5wAQC4jnABALiOcAEAuI5wAQC4jnABALiOcAEAuI5wAQC4jnABALguKtAFAKHAcRx99dVXKikpUXx8vJKTk2WMCXRZQNCi5wKcgdfr1cyZM5Wenq6UlBR17txZKSkpSk9P18yZM+X1egNdIhCUDDdRAqe2cuVKjRo1SmVlZZJs78XP32uJi4tTbm6uMjIyAlIjEKwIF+AUVq5cqczMTDmOo5qamtP+Po/HI2OMli1bRsAA9RAuwEm8Xq86duwon893xmDx83g8io2NVUFBgZKSkpq+QCAEMOcCnGTevHkqKytrVLBIUk1NjcrKyjR//vwmrgwIHfRcgHocx1F6erry8/N1Lk3DGKPU1FTt2bOHVWSACBeggcOHDyslJeWCPp+cnOxiRUBoYl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q7jx4+f8vc5jvO196qqqhQbG9sghIBIRrgAJ7Rr104+n09er1d9+/ZV69ata9/z+XzauHFjbYj069evduOkMUaXX365Dh06JI/HozZt2gTqRwCCBuECnNCrVy9VVlYqLy9PzzzzTIP38vPz1bt3bx09elTt27fXK6+8oqSkpNr3jTF65JFHdMkllzAkBojVYkCtPn36KDU1VfPmzVNpaalatGjR4B8/Y4w8Hk/t6x6PR1988YVee+01ZWZm6qKLLgrgTwEEB8IFOCE5OVkTJ07UP//5T82aNavRS4rLy8v1xBNPyOfzafz48Y1ewgyEM4bFgHruv/9+rV+/Xs8884zi4uI0YcIExcTESJKioqIUFRVV24txHEfFxcWaPn26cnJy9Pzzz+uqq64KZPlA0OD4F+AkX375pR566CG99dZbysjI0JQpU9StWzft2rVLNTU1io6OVpcuXZSXl6cZM2Zo69atevzxxzVhwoQGw2dAJCNcgFMoLS3VnDlzNGvWLB08eFCpqalKT09XQkKCioqKtGvXLh04cEC9evXS1KlTNWjQIHk8jDIDfoQLcAaFhYVavXq11q1bpw8//FB5eXkaOHCg+vfvr+HDh6tv376Ki4sLdJlA0CFcgEbatGmT+vTpo02bNunGG28MdDlAUKMfDzSSfz6F4S/g7GglAADXES4AANcRLgAA1xEuAADXES4AANcRLgAA1xEuAADXES4AANcRLgAA1xEuAADXES4AANcRLgAA1xEuAADXES4AANdxnwvQSI7jyHEcGWNkjAl0OUBQo+cCnANCBWicqEAXALihsrJSn3/+uWpqagJdygUzxujyyy9XdHR0oEsBzhvhgrBQUFCgCRMmhMX1wx988IFeeOEFpaWlBboU4LwRLggLjuOoZ8+e6t69u1atWqX4+HglJCQoOTlZnTp1Ulpamq688kq1bdu29rriYPXwww+LqVCEOsIFYeX999/XwoULv/Z6dHS0kpOT1bNnT2VmZurb3/62OnXqJI8nuKYdCRWEC8IFYaVfv36qqKhQSUmJSkpK9NVXX+ngwYM6dOiQCgsL9cUXX2jFihV64oknNGbMGE2ePFlXXHEFE/WAywgXhJWsrCxlZWVJsr2A6upq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<Figure size 500x400 with 6 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "model.plot(beta=10)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4b98a727",
   "metadata": {},
   "source": [
    "We will see that ${\\rm tanh}$ is at the top of the suggestion list! So we can set it to ${\\rm tanh}$, retrain the model to machine precision, plot it and finally get the symbolic formula."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "99ad38b9",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "   function  fitting r2    r2 loss  complexity  complexity loss  total loss\n",
      "0      tanh    0.999998 -16.336284           3                3  -16.336284\n",
      "1    arctan    0.999435 -10.764618           4                4  -10.764618\n",
      "2       cos    0.995899  -7.926177           2                2   -7.926177\n",
      "3       sin    0.995899  -7.926177           2                2   -7.926177\n",
      "4  gaussian    0.994457  -7.492519           3                3   -7.492519\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "('tanh',\n",
       " (<function kan.utils.<lambda>(x)>,\n",
       "  <function kan.utils.<lambda>(x)>,\n",
       "  3,\n",
       "  <function kan.utils.<lambda>(x, y_th)>),\n",
       " 0.9999979138374329,\n",
       " 3)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.suggest_symbolic(1,0,0,weight_simple=0.)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "af24c80d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "r2 is 0.9999979138374329\n",
      "saving model version 0.5\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "tensor(1.0000, device='cuda:0')"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "model.fix_symbolic(1,0,0,'tanh')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "01936f17",
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "| train_loss: 1.97e-06 | test_loss: 2.06e-06 | reg: 0.00e+00 | : 100%|█| 2000/2000 [00:21<00:00, 93.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "saving model version 0.6\n"
     ]
    }
   ],
   "source": [
    "model.fit(dataset, opt=\"Adam\", lr=1e-3, steps=2000, update_grid=False, singularity_avoiding=True);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "76bcc188",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZcAAAFICAYAAACcDrP3AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAAkjUlEQVR4nO3de3xU5Z3H8e8zRCAhYEIMeKEiE7IqCCqIQS5GpBI0tVpQQWtbrG0VFXfZrluXdqso6mJ1BbytxdYFtAQ1tMpliVt0QQgWQQFF7pFqiAhCJiZkyPXsHw+TC5cQ4CRnLp/365UXec1kzC8xz3zPcz3GcRxHAAC4yOd1AQCA6EO4AABcR7gAAFxHuAAAXEe4AABcR7gAAFxHuAAAXEe4AABcR7gAAFxHuAAAXEe4AABcR7gAAFxHuAAAXEe4AABcR7gAAFwX53UBQCRwHEf79u1TWVmZEhMTlZKSImOM12UBYYueC9CEQCCg6dOnKz09XampqerRo4dSU1OVnp6u6dOnKxAIeF0iEJYMd6IEji4vL0+jR49WeXm5JNt7CQn1WhISEpSbm6usrCxPagTCFeECHEVeXp6ys7PlOI5qa2uP+XU+n0/GGC1atIiAARogXIDDBAIBdevWTcFgsMlgCfH5fIqPj1dhYaGSkpJavkAgAjDnAhxm1qxZKi8vb1awSFJtba3Ky8s1e/bsFq4MiBz0XIAGHMdRenq6CgoKdCJNwxgjv9+vbdu2sYoMEOECNPLNN98oNTX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6enpmj59ugKBgNclAi2uYTsYdvXVqqio0LCrr6YdhDnjEP9hKS8vT6NHj1Z5ebkk6WLH0SpJV0hab4wkKSEhQbm5ucrKyvKuUKAFHd4O+jZoBxtoB2GNnksYysvLU3Z2toLBoBzHOaL7H3osGAwqOztbeXl5HlUKtBzaQWSj5xJmAoGAunXrpmAwqNra2rrHL5HqrtjWNfh6n8+n+Ph4FRYWKikpqTVLBVrMsdrBxapvB+sbfD3tIPzQcwkzs2bNUnl5eaMG1ZTa2lqVl5dr9uzZLVwZ0HpoB5GPnksYcRxH6enpKigoOGII4BIdveciScYY+f1+bdu2TebQODQQqZpqB8fquUi0g3BDzyWM7Nu3Tzt27DjhJZaO42jHjh3av39/C1UGtB7aQXQgXMJIWVnZKb2+tLTUpUoA79AOogPhEkYSExOP+dwW2aGALU28vmPHjm6XBLS6ptrBVtl2sLWJ19MOwgPhEkZSUlKUlpZ21PHioOxcS/AorzPGKC0tTZ07d27hCoGWd7x2sF60g0hAuIQRY4wmTJhwUq+9//77mcREVKAdRAdWi4WZY63vPxbW9yMa0Q4iHz2XMJOUlKTc3FwZY+TzNf2/x+fzyRij+fPn06AQVWgHkY9wCUNZWVlatGiR4uPjZYw5opsfeiw+Pl6LFy/WiBEjPKoUaDm0g8hGuISprKwsFRYWatq0afL7/Y2e8/v9mjZtmnbt2kWDQlSjHUQu5lwigOM42r9/v0pLS9WxY0d17tyZSUvEHNpBZCFcAACuY1gMAOA6wgUA4DrCBQDgOsIFAOA6wgUA4DrCBQDgOsIFAOA6wgUA4DrCBQDgOsIFAOA6wgUA4DrCBQDgOsIFAOA6wgUA4Lr/B/kEiCZxLfAzAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 500x400 with 6 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "model.plot()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "b62b0246",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/latex": [
       "$\\displaystyle \\tanh{\\left(\\operatorname{atanh}{\\left(x_{1} \\right)} + \\operatorname{atanh}{\\left(x_{2} \\right)} \\right)}$"
      ],
      "text/plain": [
       "tanh(atanh(x_1) + atanh(x_2))"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "formula = model.symbolic_formula()[0][0]\n",
    "nsimplify(ex_round(formula, 4))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
